sap.ui.define([
    'jquery.sap.global', 'sap/ui/core/mvc/Controller', 'sap/ui/model/json/JSONModel', 'sap/m/MessageToast'
], function(jQuery, Controller, JSONModel, MessageToast, Formatter) {

    "use strict";

    var creationCtrl = Controller.extend("sap.lx.nba.man.edit", {

        onInit: function(event) {

            var router = this.getRouter();
            router.attachRoutePatternMatched(function(event) {
                if (event.getParameter("name") !== "manedit") {
                    return;
                }

                var id = event.getParameter("arguments").Id;

                this.id = id;

                var model = new JSONModel();

                model.loadData("../get/man", {
                    id: id
                }, true, "POST");
                this.getView().setModel(model, "man");
                this.model_apps = model;

            }, this);

        },
        getRouter: function() {
            return sap.ui.core.UIComponent.getRouterFor(this);
        },
        onNavButtonPress: function() {

            var router = this.getRouter();
            router.navTo("man");

        },
        onSave: function() {

            window.location = "../nba/#/man";

        },
        onDelete: function() {

        }

    });

    return creationCtrl;

});
